package com.macrounion.atv.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/web/protocolc")
public class ProtocolCController {

    @RequestMapping("/index")
    public ModelAndView index() {
        return new ModelAndView("/protocolc/index");
    }

    @RequestMapping("/config")
    public ModelAndView protocolconfig(@RequestParam(value = "id") String id, @RequestParam(value = "stype") String stype) {
        Map<String, String> params = new HashMap();
        params.put("id", id);
        params.put("stype", stype);
        return new ModelAndView("/protocolc/config", params);
    }

    @RequestMapping("/trap")
    public ModelAndView traplist(@RequestParam(value = "id") String id) {
        Map<String, String> params = new HashMap();
        params.put("id", id);
        return new ModelAndView("/protocolc/traplist", params);
    }
}